﻿@model Bibilioteca.Models.Material

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Material</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Codigo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Codigo)
            @Html.ValidationMessageFor(model => model.Codigo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Titulo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Titulo)
            @Html.ValidationMessageFor(model => model.Titulo)
        </div>

        <div class="editor-label">
            Autores
        </div>
        <div class="editor-field">
            @Html.ListBoxFor(model => model.Autores, ViewBag.Autores as MultiSelectList)
            @Html.ValidationMessageFor(model => model.Autores)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sinopsis)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sinopsis)
            @Html.ValidationMessageFor(model => model.Sinopsis)
        </div>

        <div class="editor-label">
                Tipo de Material
            </div>
            <div class="editor-field">
                @Html.DropDownListFor(model => model.SelectedTipoMaterial, new SelectList(ViewBag.TiposMateriales, "Value", "Text"))
                @Html.ValidationMessageFor(model => model.SelectedTipoMaterial)
            </div>

        <div class="editor-label">
                Editorial
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.SelectedEditorial, new SelectList(ViewBag.Editoriales, "Value", "Text"))
            <!-- @Html.EditorFor(model => model.SelectedEditorial) -->
            @Html.ValidationMessageFor(model => model.SelectedEditorial)
        </div>

        <div class="editor-label">
               Catalogo
        </div>
        <div class="editor-field">
            @Html.DropDownListFor(model => model.SelectedCatalogo, new SelectList(ViewBag.Catalogos, "Value", "Text"))
            <!-- @Html.EditorFor(model => model.SelectedCatalogo) -->
            @Html.ValidationMessageFor(model => model.SelectedCatalogo)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
